import myaxios from "../MyAxios";

import URLENV from '@/http/BaseUrl'
const BASEURL = URLENV.BASEURL

const dongmanApi = {


  /**
   * 通过页码/每页条目数据  分页查询动漫列表
   * @param {Object} params {page:1, pagesize:3}
   */
  queryAll (params) {
    let url = BASEURL + "/dongman-infos"
    return myaxios.get(url, params)
  },
  /**
     * 模糊查询动画列表
     * @param {Object} params {name, page, pagesize,type}
     * /query-infosByname?name=测&page=1&pagesize=10&type=dongman
     */
  queryAllByName (params) {
    let url =
      BASEURL +
      `/query-infosByname`;
    return myaxios.get(url, params);
  },
  /**
    * 删除动画
    * @param {Object} params  id和type
    * http://121.37.91.153:3010/query-delete
    */
  delete (params) {
    let url = BASEURL + "/query-delete";
    return myaxios.post(url, params);
  },
  /** 新增动画 */
  add (params) {
    let url = BASEURL + "/admin/yinshi_add";
    return myaxios.post(url, params);
  },
  /** 通过ID和类别, 查询动画详情 
  *  @params {Object} params  {id:11}
  *   id: this.$route.params.id,
     type: '动画'
   }
   http://121.37.91.153:3010/query-infosByid?id=2&type=movie
  */
  queryById (params) {
    let url = BASEURL + `/query-infosByid?`;
    return myaxios.get(url, params);
  },
  /** 修改动画信息
* http://121.37.91.153:3010/admin/yinshi_xiugai
*/
  update (params) {
    let url = BASEURL + "/admin/yinshi_xiugai";
    return myaxios.post(url, params);
  },

}

export default dongmanApi;